home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 September
/
PCWorld_2008-09_cd.bin
/
v cisle
/
sadanastroju
/
wot-20080519-fx.xpi
/
chrome
/
wot.jar
/
content
/
storage.js
< prev
next >
Wrap
Text File
|
2007-11-11
|
1KB
|
68 lines
/*
storage.js
Copyright © 2006, 2007 Against Intuition, Inc. <info@mywot.com>
*/
var wot_hashtable =
{
init: function()
{
try {
if (this.bag) {
return;
}
this.bag = Components.classes["@mozilla.org/hash-property-bag;1"].
getService(Components.interfaces.nsIWritablePropertyBag);
} catch (e) {
dump("wot_hashtable.init: failed with: " + e + "\n");
}
window.addEventListener("unload", function(e) {
wot_hashtable.unload(); }, false);
},
unload: function()
{
this.bag = null;
},
set: function(name, value)
{
try {
this.bag.setProperty(name, value);
} catch (e) {
dump("wot_hashtable.set: failed with " + e + "\n");
}
},
get: function(name)
{
try {
return this.bag.getProperty(name);
} catch (e) {
}
return null;
},
remove: function(name)
{
try {
this.bag.deleteProperty(name);
} catch (e) {
}
},
get_enumerator: function(name)
{
try {
return this.bag.enumerator;
} catch (e) {
dump("wot_hashtable.get_enumerator: failed with " + e + "\n");
}
return null;
}
};
wot_hashtable.init();